package com.broada.apm.logic.impl;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.broada.apm.base.BaseLogic;
import com.broada.apm.logic.ProtocalLogic;
import com.broada.apm.model.L7Module;
import com.broada.apm.utils.ExceptionUtils;

public class ProtocalLogicImpl extends BaseLogic implements ProtocalLogic {
	
	private static final int SYNCMODULE = 1;

	private static Logger log = LoggerFactory.getLogger(ProtocalLogicImpl.class);

	@Override
	public List<L7Module> queryL7Protocals() {
		List<L7Module> list = new ArrayList<L7Module>();
		try {
			List<L7Module> temp = l7ModuleService.getAllL7Modules();
			for (L7Module l7Module : temp) {
				if (l7Module.getL7_proto() != SYNCMODULE) {
					list.add(l7Module);
				}
			}
		} catch (Exception e) {
			ExceptionUtils.error(log, "获取L7协议数据失败", e);
		}
		return list;
	}

}
